/**
 * This JavaScript Library is the proprietary of Formative soft Ltd. Developed by
 * Formative Lab development team. This JavaScript Library may be used without 
 * any grantee. Formative Soft Ltd does not liable for any kind loss used by this
 * library.
 *
 * @static
 * @access		public
 * @version		1.0.0
 * @since		May 20, 2013
 * @author		Formative Lab
 * @vendor		Formative Soft Ltd
 * @web			www.formativesoft.com
 *
 **/
(function(){
	var Fsl = {
		$class      : 'Fsl',
		$package    : 'Defaults',
		version     : '1.0.0',
		since       : 'May 20, 2013',
		author      : 'Formative Lab',
		vendor      : 'Formative Soft Ltd',		
		web         : 'www.formativesoft.com',
		email       : 'formative.soft@gmail.com',
		userAgent   : navigator.userAgent.toLowerCase(),
		isStrict    : document.compatMode == "CSS1Compat",
		docMode     : document.documentMode,
		isSecure    : /^https/i.test(window.location.protocol)
	};
	window.Fsl = Fsl;
}());

/**
 * This JavaScript Library use for get browser information. Such as Browser name, version,
 * browser compartibility. This library may be helpful for cross browser platform.
 *
 * @static
 * @class       browser
 * @package     Fsl.browser
 * @access      public
 * @version     1.0.0
 * @since       May 28, 2013
 *
 **/
;Fsl.browser||(function($){
	var browser = {
		$class      : 'browser',
		$package    : 'Fsl.browser',		
		check       : function(regex){
			return regex.test(Fsl.userAgent);
		},
		version     : function (is, regex) {
			var m;
			return (is && (m = regex.exec(Fsl.userAgent))) ? parseFloat(m[1]) : 0;
		},
		isOpera     : function(){
			return browser.check(/opera/);
		},
		isOpera10_5 : function(){
			return browser.isOpera() && browser.check(/version\/10\.5/);
		},
		isChrome    : function(){
			return browser.check(/\bchrome\b/);
		},
		isWebKit    : function(){
			return browser.check(/webkit/);
		},
		isSafari    : function(){
			return !browser.isChrome() && browser.check(/safari/);
		},
		isSafari2   : function(){
			return browser.isSafari() && browser.check(/applewebkit\/4/);
		},
		isSafari3   : function(){
			return browser.isSafari() && browser.check(/version\/3/);
		},
		isSafari4   : function(){
			return browser.isSafari() && browser.check(/version\/4/);
		},
		isSafari5_0 : function(){
			return browser.isSafari() && browser.check(/version\/5\.0/);
		},
		isSafari5   : function(){
			return browser.isSafari() && browser.check(/version\/5/);
		},
		isIE        : function(){
			return !browser.isOpera() && browser.check(/msie/);
		},
		isIE7       : function(){
			return browser.isIE() && ((browser.check(/msie 7/) && Fsl.docMode != 8 && Fsl.docMode != 9 && Fsl.docMode != 10) || Fsl.docMode == 7);
		},
		isIE8       : function(){
			return browser.isIE() && ((browser.check(/msie 8/) && Fsl.docMode != 7 && Fsl.docMode != 9 && Fsl.docMode != 10) || Fsl.docMode == 8);
		},
		isIE9       : function(){
			return browser.isIE() && ((browser.check(/msie 9/) && Fsl.docMode != 7 && Fsl.docMode != 8 && Fsl.docMode != 10) || Fsl.docMode == 9);
		},
		isIE10      : function(){
			return browser.isIE() && ((browser.check(/msie 10/) && Fsl.docMode != 7 && Fsl.docMode != 8 && Fsl.docMode != 9) || Fsl.docMode == 10);
		},
		isIE6       : function(){
			return browser.isIE() && browser.check(/msie 6/);
		},
		isGecko     : function(){
			return !browser.isWebKit() && browser.check(/gecko/);
		},
		isGecko3    : function(){
			return browser.isGecko() && browser.check(/rv:1\.9/);
		},
		isGecko4    : function(){
			return browser.isGecko() && browser.check(/rv:2\.0/);
		},
		isGecko5    : function(){
			return browser.isGecko() && browser.check(/rv:5\./);
		},
		isGecko10   : function(){
			return browser.isGecko() && browser.check(/rv:10\./);
		},
		isFF3_0     : function(){
			return browser.isGecko3() && browser.check(/rv:1\.9\.0/);
		},
		isFF3_5     : function(){
			return browser.isGecko3() && browser.check(/rv:1\.9\.1/);
		},
		isFF3_6     : function(){
			return browser.isGecko3() && browser.check(/rv:1\.9\.2/);
		},
		isWindows   : function(){
			return browser.check(/windows|win32/);
		},
		isMac       : function(){
			return browser.check(/macintosh|mac os x/);
		},
		isLinux     : function(){
			return browser.check(/linux/);
		},
		chromeVersion  : function(){
			return browser.version(true, /\bchrome\/(\d+\.\d+)/);
		},
		firefoxVersion : function(){
			return browser.version(true, /\bfirefox\/(\d+\.\d+)/);
		},
		ieVersion      : function(){
			return browser.version(browser.isIE(), /msie (\d+\.\d+)/);
		},
		operaVersion   : function(){
			return browser.version(browser.isOpera(), /version\/(\d+\.\d+)/);
		},
		safariVersion  : function(){
			return browser.version(browser.isSafari(), /version\/(\d+\.\d+)/);
		},
		webKitVersion  : function(){
			return browser.version(browser.isWebKit(), /webkit\/(\d+\.\d+)/);
		}
	};
	$.browser = browser;
}(Fsl));

/**
 * This JavaScript Library use to syncronized with CodeIgniter HMVC routing. This
 * library as bridge to perform ajax request to request CI Controller Action. This
 * library has some dynamic portion and generated from server side.
 *
 * @static
 * @class       route
 * @package     Fsl.route
 * @access      public
 * @version     1.0.0
 * @since       May 20, 2013
 *
 **/
;Fsl.route||(function($){
	var route = {
		$class		: 'route',
		$package	: 'Fsl.route',		
		getSite		: function(action){
			var site 	= '<?php echo site_url(); ?>';
			site		= route.addForwardSlash(site);			
			action		= (typeof action === 'undefined') ? '' : action;
			action		= route.addForwardSlash(action);
			return site + action;			
		},
		getBase		: function(resource){
			var base 	= '<?php echo base_url(); ?>';
			base		= route.addForwardSlash(base);
			resource 	= (typeof resource === 'undefined') ? '' : resource;
			resource	= route.addForwardSlash(resource);
			return base + resource;
		},
		getAction 	: function(action){
			action = (typeof action === 'undefined') ? '' : action;
			return route.getSite(action);
		},
		getResource 	: function(resource){
			resource = (typeof resource === 'undefined') ? '' : resource;
			resource = 'resources' + '/' + resource;
			return route.getBase(resource);
		},
		getIcon         : function(icon){
			icon = 'icon' + '/' + icon;
			return route.getResource() + icon;
		},
		getImage        : function(image){
			image = 'images' + '/' + image;
			return route.getResource() + image;
		},
		getUxFolder     : function(uxFolder){
			uxFolder = (typeof uxFolder === 'undefined') ? '' : uxFolder;
			return route.getResource() + uxFolder;
		},
		getAppFolder	: function(appFolder){
			appFolder = (typeof appFolder === 'undefined') ? '' : appFolder;
			return route.getResource() + appFolder;
		},
		addForwardSlash	: function(url){
			var length			= url.length;
			if(length > 0){
				var lastChar	= url.charAt(length-1),
				hasForwardSlash	= lastChar == '/';
				url             = hasForwardSlash ? url : url + "/";
			}
			return url;
		}
	};
	$.route = route;
}(Fsl));

/**
 * This JavaScript Library used by Extjs 4.1 Data Package to syncronized Extjs 4.1 MVC
 * data with remote rest application thats means to perform data request and response
 * with CodeIgniter HMVC. This libray will be use for JSON, JSONP, AJAX operation to 
 * read or write data.
 *
 * @static
 * @class       proxy
 * @package     Fsl.proxy
 * @access      public
 * @version     1.0.0
 * @since       May 21, 2013
 *
 **/
;Fsl.proxy||(function($){
	var proxy = {
		$class		: 'proxy',
		$package	: 'Fsl.proxy',
		resolveUrl  : function(component){
			var url,
			ucomponent = component.toUpperCase(),
			lcomponent = component.toLowerCase();
			if(Fsl.app.isModullar(ucomponent)){
				var module  = Fsl.app.getModule(ucomponent),				
				submodule   = Fsl.app.getSubmodule(ucomponent),
				controller  = 'c' + lcomponent.substring(1);				
				url = module + '/'+ submodule + '/' + controller;
			}else{
				url = lcomponent;
			}
			return $.route.getAction(url);
		},
		getApi		: function(controller){
			var url	= proxy.resolveUrl(controller),
			create	= url + $.route.addForwardSlash('create'),
			read	= url + $.route.addForwardSlash('read'),
			update	= url + $.route.addForwardSlash('update'),
			destroy	= url + $.route.addForwardSlash('destroy'),
			api 	=  {
				create  : create,
				read    : read,
				update  : update,
				destroy : destroy
			};
			return api;
		},
		getStoreApi	: function(controller){
			var url	= proxy.resolveUrl(controller),
			create	= url + $.route.addForwardSlash('bcreate'),
			read	= url + $.route.addForwardSlash('bread'),
			update	= url + $.route.addForwardSlash('bupdate'),
			destroy	= url + $.route.addForwardSlash('bdestroy'),
			api 	=  {
				create  : create,
				read    : read,
				update  : update,
				destroy : destroy
			};
			return api;
		},
		getActionMethods    : function(){
			var actionMethods =  {
				create  : 'POST',
				read    : 'GET',
				update  : 'POST',
				destroy : 'POST'
			};
			return actionMethods;
		},
		getReader           : function(){
			var reader =  {
				type            : 'json',
				root            : 'data',
				totalProperty   : 'total',
				successProperty : 'success',
				messageProperty : 'message',
				implicitIncludes: true
			};
			return reader;
		},
		getWriter           : function(){
			var writer =  {
				type      : 'json',
				root      : 'data',
				writeAllFields: true 
			};
			return writer;
		},		
		getAjaxUrlProxy     : function(url, noCache){
			url     = (typeof url === 'undefined') ? '' : url;
			noCache = (typeof noCache === 'undefined') ? false : noCache;
			var ajaxUrlProxy	= {
				type            : 'ajax',
				noCache         : noCache,
				limitParam      : 'limit',
				startParam      : 'start',
				url             : proxy.resolveUrl(url),      
				reader          : proxy.getReader(),
				writer          : proxy.getWriter(),
				simpleSortMode  : true
			};	
			return ajaxUrlProxy;
		},	
		getAjaxApiProxy		: function(url, noCache){
			url     = (typeof url === 'undefined') ? '' : url;
			noCache = (typeof noCache === 'undefined') ? false : noCache;
			var ajaxApiProxy	= {
				type            : 'ajax',
				noCache         : noCache,
				limitParam      : 'limit',
				startParam      : 'start',
				api             : proxy.getApi(url),
				actionMethods   : proxy.getActionMethods(),          
				reader          : proxy.getReader(),
				writer          : proxy.getWriter(),
				simpleSortMode  : true
			};	
			return ajaxApiProxy;
		},
		getStoreAjaxUrlProxy: function(url, noCache){
			url	      = proxy.resolveUrl((typeof url === 'undefined') ? '' : url);
			var store = $.route.addForwardSlash(url) + 'store';
			noCache = (typeof noCache === 'undefined') ? false : noCache;
			var ajaxUrlProxy	= {
				type            : 'ajax',
				noCache         : noCache,
				limitParam      : 'limit',
				startParam      : 'start',
				url             : store,      
				reader          : proxy.getReader(),
				writer          : proxy.getWriter(),
				simpleSortMode  : true
			};	
			return ajaxUrlProxy;
		},
		getStoreAjaxApiProxy: function(url, noCache){
			url     = (typeof url === 'undefined') ? '' : url;
			noCache = (typeof noCache === 'undefined') ? false : noCache;
			var ajaxApiProxy	= {
				type            : 'ajax',
				noCache         : noCache,
				limitParam      : 'limit',
				startParam      : 'start',
				api             : proxy.getStoreApi(url),
				actionMethods   : proxy.getActionMethods(),          
				reader          : proxy.getReader(),
				writer          : proxy.getWriter(),
				simpleSortMode  : true
			};	
			return ajaxApiProxy;
		}
	};
	$.proxy = proxy;
}(Fsl));

/**
 * This JavaScript Library use for Extjs 4.1 data package for to ensure cardinality
 * of different type of association such as bleongs to, has one, has many and many to
 * many.
 *
 * @static
 * @class       data
 * @package     Fsl.data
 * @access      public
 * @version     1.0.0
 * @since       May 21, 2013
 *
 **/
;Fsl.data||(function($){
	var data = {
		$class		: 'data',
		$package	: 'Fsl.data',
		getAssociationName  : function(associationKey){
			var prefix     = associationKey.charAt(0).toUpperCase(),
			suffix         = associationKey.substring(1),
			associatedName = prefix + suffix;
			return associatedName;
		},
		getAssociation		: function(model, primaryKey, foreignKey, associationKey){
			var associatedName  = data.getAssociationName(associationKey),
			association         = {
				model           : $.app.getAbsModel(model),
				associatedName  : associatedName,
				associationKey  : associationKey,
				primaryKey      : primaryKey,
				foreignKey      : foreignKey,
				reader          : $.proxy.getReader()            
			};
			return association;
		},
		getHasMany		: function(model, primaryKey, foreignKey, associationKey){
			return data.getAssociation(model, primaryKey, foreignKey, associationKey);			
		},
		getBelongsTo	: function(model, primaryKey, foreignKey, associationKey){
			var associatedName  = data.getAssociationName(associationKey),
			belongsTo           = {
				model           : $.app.getAbsModel(model),
				associatedName  : associatedName,
				associationKey  : associationKey,
				primaryKey      : primaryKey,
				foreignKey      : foreignKey
			};
			return belongsTo;
		},
		getHasOne       : function(model, primaryKey, foreignKey, associationKey){
			return data.getBelongsTo(model, primaryKey, foreignKey, associationKey);			
		}
	};
	$.data = data;
}(Fsl));

/**
 * This JavaScript Library use for hashed history token. Hashed history token prevent
 * realoading the page or onload it use to exact component what was opened or you what
 * is you want to open.
 *
 * @static
 * @class       history
 * @package     Fsl.history
 * @access      public
 * @version     1.0.0
 * @since       May 25, 2013
 *
 **/
;Fsl.history||(function($){
	var history = {
		$class      : 'history',
		$package    : 'Fsl.history',		
		getToken    : function(){
			var token   = location.hash.substring(1);
			return token;			
		},
		setToken    : function(token){
			location.hash = token;
		},
		clearToken  : function(){
			history.setToken(null);
		}
	};
	$.history = history;
}(Fsl));

/**
 * This JavaScript Library use for hashed navigate token. Hashed navigate token prevent
 * realoading the page or onload it use to exact component what was opened or you what
 * is you want to open.
 *
 * @static
 * @class       navigate
 * @package     Fsl.navigate
 * @access      public
 * @version     1.0.0
 * @since       May 25, 2013
 *
 **/
;Fsl.navigate||(function($){
	var navigate = {
		$class      : 'navigate',
		$package    : 'Fsl.navigate',		
		setSelect   : function(treeView, defaultNode){
			var activeNode = $.history.getToken();
			activeNode     = activeNode ? activeNode : defaultNode;
			var record     = treeView.store.find('id', activeNode);
			setTimeout(function(){
				treeView.select(record);
			}, 0);			
		},
		setActive   : function(treeNode, tabPanel){
			//TODO
		}
	};
	$.navigate = navigate;
}(Fsl));

/**
 * This JavaScript Library use for most common reqular expression used by the application.
 * This library help us to use regular expression from an centeralized system. Could be
 * change any regular expression without changing source.
 *
 * @static
 * @class       regexp
 * @package     Fsl.regexp
 * @access      public
 * @version     1.0.0
 * @since       May 26, 2013
 *
 **/
;Fsl.regexp||(function($){
	var regexp = {
		$class      : 'regexp',
		$package    : 'Fsl.regexp',
		isObject    : function(input){
			return typeof input == 'object';
		},
		isArray     : function(input){
			return (regexp.isObject(input) && input.constructor === Array);
		},
		isEmpty     : function(input){
			if(typeof input == 'undefined' || input === null || input === ''){
				return true;
			}else if(typeof input == 'number' && isNaN(input)){
				return true;
			}else if(input instanceof Date && isNaN(Number(input))){
				return true;
			}
			return false;
		},
		isString    : function(input){
			return typeof input === 'string' ||
			(regexp.isObject(input) && input.constructor === String);
		},
		isNumber    : function(input){
			return typeof input === 'number' ||
			(regexp.isObject(input) && input.constructor === Number);
		},
		isUndefined : function(input){
			return typeof input === 'undefined';
		},
		getPattern  : function(pattern){
			if(regexp.isObject(pattern)){
				if(pattern.constructor === RegExp){
					return pattern;
				}else{
					return pattern.toString();
				}
			}
		},
		isMatch     : function(input, pattern){
			var validator = new RegExp(regexp.getPattern(pattern));
			if(regexp.isUndefined(input)){
				return false;
			}else if(regexp.isString(input)){
				return validator.test(input);
			}else if(regexp.isNumber(input)){
				input = input + '';
				return validator.test(input);
			}
			return false;
		},
		Address     : {
			bn : {
				op : /^[\u0980-\u09FF\d\u0964,.#:\-\/ ]{0,200}$/,
				re : /^[\u0980-\u09FF\d\u0964,.#:\-\/ ]{1,200}$/,
				toString : function(){
					return /^[\u0980-\u09FF\d\u0964,.#:\-\/ ]{0,200}$/;
				}
			},
			en : {
				op : /^[\w,.#:\-\/ ]{0,100}$/,
				re : /^[\w,.#:\-\/ ]{1,100}$/,
				toString : function(){
					return /^[\w,.#:\-\/ ]{1,100}$/;
				}
			},
			toString : function(){
				return /^[\w,.#:\-\/ ]{1,100}$/;
			}
		},
		Bangla      : {
			op : /^[\u0980-\u09FF\d\u0964,.#:\-\/ ]{0,100}$/,
			re : /^[\u0980-\u09FF\d\u0964,.#:\-\/ ]{1,100}$/,
			toString : function(){
				return /^[\u0980-\u09FF\d\u0964,.#:\-\/ ]{0,100}$/;
			}
		},
		Blood       : {
			bn : /^[\u098F|\u09AC\u09BF|\u098F\u09AC\u09BF|\u0993]{1,3}[+-]{1}$/,
			en : /^[A|a|B|b|AB|ab|O|o]{1,2}[+-]{1}$/,
			toString : function(){
				return /^[A|a|B|b|AB|ab|O|o]{1,2}[+-]{1}$/;
			}
		},
		Continent   : {
			bn : /^[\u0980-\u09FF.\- ]{0,100}$/,
			en : /^[a-zA-Z.\- ]{3,45}$/,
			toString : function(){
				return /^[a-zA-Z.\- ]{3,45}$/;
			}
		},
		Country     : {
			bn : /^[\u0980-\u09FF.\- ]{0,100}$/,
			en : /^[a-zA-Z.\- ]{2,45}$/,
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		County      : {
			bn : /^[\u0980-\u09FF.\- ]{0,100}$/,
			en : /^[a-zA-Z.\- ]{2,45}$/,
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		Contact     : /^([\d]{5,16}|([\+]{1}[\d]{10,15})|([\+]{1}|[0]{2})[\(]{1}[\d]{2,3}[\)]{1}[\d]{8,13})|((([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))$/,
		ContactNo   : /^[\d]{5,16}|([\+]{1}[\d]{10,15})|([\+]{1}|[0]{2})[\(]{1}[\d]{2,3}[\)]{1}[\d]{8,13}$/,
		Email       : /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
		English     : {
			op : /^[\w,.#:\-/ ]{0,45}$/,
			re : /^[\w,.#:\-/ ]{1,45}$/,
			toString : function(){
				return /^[\w,.#:\-/ ]{1,45}$/;
			}
		},
		FirstName   : {
			bn : {
				op : /^[\u0980-\u09FF.\- ]{0,100}$/,
				re : /^[\u0980-\u09FF.\- ]{1,100}$/,
				toString : function(){
					return /^[\u0980-\u09FF.\- ]{0,100}$/;
				}
			},
			en : {
				op : /^[a-zA-Z.\- ]{0,45}$/,
				re : /^[a-zA-Z.\- ]{2,45}$/,
				toString : function(){
					return /^[a-zA-Z.\- ]{2,45}$/;
				}
			},
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		Form        : /^F[\d]{2}[B|I|Q|R|S|T|X][\d]{6}$/,
		FullName    : {
			bn : {
				op : /^[\u0980-\u09FF.\- ]{0,100}$/,
				re : /^[\u0980-\u09FF.\- ]{1,100}$/,
				toString : function(){
					return /^[\u0980-\u09FF.\- ]{0,100}$/;
				}
			},
			en : {
				op : /^[a-zA-Z.\- ]{0,45}$/,
				re : /^[a-zA-Z.\- ]{2,45}$/,
				toString : function(){
					return /^[a-zA-Z.\- ]{2,45}$/;
				}
			},
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		LabelForm   : /^[\w]{3,30}$/,
		LabelReport : /^[L]{1}[B]{1}[L]{1}[_]{1}[A-Z0-9]{2,30}$/,
		LastName    : {
			bn : {
				op : /^[\u0980-\u09FF.\- ]{0,100}$/,
				re : /^[\u0980-\u09FF.\- ]{1,100}$/,
				toString : function(){
					return /^[\u0980-\u09FF.\- ]{0,100}$/;
				}
			},
			en : {
				op : /^[a-zA-Z.\- ]{0,45}$/,
				re : /^[a-zA-Z.\- ]{2,45}$/,
				toString : function(){
					return /^[a-zA-Z.\- ]{2,45}$/;
				}
			},
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		MiddleName : {
			bn : {
				op : /^[\u0980-\u09FF.\- ]{0,100}$/,
				re : /^[\u0980-\u09FF.\- ]{1,100}$/,
				toString : function(){
					return /^[\u0980-\u09FF.\- ]{0,100}$/;
				}
			},
			en : {
				op : /^[a-zA-Z.\- ]{0,45}$/,
				re : /^[a-zA-Z.\- ]{2,45}$/,
				toString : function(){
					return /^[a-zA-Z.\- ]{2,45}$/;
				}
			},
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		NickName    : {
			bn : {
				op : /^[\u0980-\u09FF.\- ]{0,100}$/,
				re : /^[\u0980-\u09FF.\- ]{1,100}$/,
				toString : function(){
					return /^[\u0980-\u09FF.\- ]{0,100}$/;
				}
			},
			en : {
				op : /^[a-zA-Z.\- ]{0,45}$/,
				re : /^[a-zA-Z.\- ]{2,45}$/,
				toString : function(){
					return /^[a-zA-Z.\- ]{2,45}$/;
				}
			},
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		Name        : {
			bn : {
				op : /^[\u0980-\u09FF.\- ]{0,100}$/,
				re : /^[\u0980-\u09FF.\- ]{1,100}$/,
				toString : function(){
					return /^[\u0980-\u09FF.\- ]{0,100}$/;
				}
			},
			en : {
				op : /^[a-zA-Z.\- ]{0,45}$/,
				re : /^[a-zA-Z.\- ]{2,45}$/,
				toString : function(){
					return /^[a-zA-Z.\- ]{2,45}$/;
				}
			},
			toString : function(){
				return /^[a-zA-Z.\- ]{2,45}$/;
			}
		},
		PostCode    : /^[\d]{0,4}$/,
		Report      : /^R[\d]{2}[B|I|Q|R|S|T|X][\d]{6}$/,
		Subreport   : /^R[\d]{2}[B|I|Q|R|S|T|X][\d]{6}[X][\d]{2}$/
	};
	$.regexp = regexp;
}(Fsl));

/**
 * This JavaScript Library use to get meta-data about Extjs 4.1 application. Such
 * as Application name, AppFolder etc.
 *
 * @static
 * @class       app
 * @package     Fsl.app
 * @access      public
 * @version     1.0.0
 * @since       May 29, 2013
 *
 **/
;Fsl.app||(function($){
	var app = {
		$class               : 'app',
		$package             : 'Fsl.app',
		ModuleRegex          : /^m[\d]{2}001$/,
		SubmoduleRegex       : /^m[\d]{2}[b|i|q|r|s|t|x]{1}001$/,
		ViewpkgRegex         : /^v[\d]{2}[b|i|q|r|s|t|x]{1}[\d]{6}$/,
		ModelRegex           : /^M[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}$/,
		ViewRegex            : /^V[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}$/,		
		StoreRegex           : /^S[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}$/,
		DataRegex            : /^D[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}$/,
		UtilRegex            : /^U[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}$/,
		ControllerRegex      : /^C[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}$/,
		SubviewRegex         : /^V[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}[X]{1}[\d]{2}$/,		
		getName              : function(){
			return $.cfg.appName;
		},
		getPath              : function(){
			var resources = Fsl.route.getAppFolder(),
			pattern       = /^resources[\w\/]$/,
			isSDKJsb3Mode = pattern.test(resources),
			appFolder     = $.cfg.appFolder,
			appPath       = isSDKJsb3Mode ? appFolder : Fsl.route.getAppFolder(appFolder);
			return appPath;
		},
		getAlias             :function(component){
			return 'widget.'+ component.toLowerCase();
		},
		getXtype             : function(xtype){
			if(app.isComponent(xtype)){
				return xtype.toLowerCase();
			}else{
				return xtype;
			}
		},
		getWidget            : function(widget){
			if(app.isComponent(widget)){
				var alias = widget.toLowerCase();
				return Ext.widget(alias);
			}else{
				return Ext.widget(widget);
			}
		},
		getUxpath            : function(){
			var resources = Fsl.route.getAppFolder(),
			pattern       = /^resources[\w\/]$/,
			isSDKJsb3Mode = pattern.test(resources),
			uxFolder      = $.cfg.uxFolder,
			uxPath        = isSDKJsb3Mode ? uxFolder : Fsl.route.getAppFolder(uxFolder);		
			return uxPath;
		},
		isModule             : function(module){
			return app.ModuleRegex.test(module);
		},
		isSubmodule          : function(submodule){
			return app.SubmoduleRegex.test(submodule);
		},
		isModel              : function(model){
			return app.ModelRegex.test(model);
		},
		isView               : function(view){
			return app.ViewRegex.test(view);
		},
		isViewpkg            : function(viewpkg){
			return app.ViewpkgRegex.test(viewpkg);
		},
		isSubview            : function(subview){
			return app.SubviewRegex.test(subview);
		},
		isStore              : function(store){
			return app.StoreRegex.test(store);
		},
		isData               : function(data){
			return app.DataRegex.test(data);
		},
		isUtil               : function(util){
			return app.UtilRegex.test(util);
		},
		isController         : function(controller){
			return app.ControllerRegex.test(controller);
		},
		isComponent          : function(component){
			return (app.isModel(component)||app.isView(component)||
			app.isSubview(component)||app.isController(component)||
			app.isStore(component)  ||app.isData(component)||app.isUtil(component));
		},
		isModullar           : function(component){
			var module        = app.getModule(component);
			return app.isModule(module);
		},
		isAppModule          : function(module){
			var appName  = app.getName(),
			differents   = appName.length - module.length;
			return differents >= 0 && appName.lastIndexOf(module) === differents;
		},
		getModule            : function(submodule){
			submodule         = app.isComponent(submodule) ?
			                  app.getSubmodule(submodule) : submodule;
			if(app.isSubmodule(submodule)){
				var suffix  = '001',
				prefix      = 'm' + submodule.substring(1, 3),
				module      = prefix + suffix;
				return module.toLowerCase();
			}
		},	
		getSubmodule         : function(component){
			if(app.isComponent(component)){
				var suffix  = '001',
				prefix      = 'm' + component.substring(1, 4),
				submodule   = prefix + suffix;
				return submodule.toLowerCase();
			}
		},
		getView              : function(subview){
			if(app.isSubview(subview)){
				return subview.substr(0, 10);
			}
		},
		getViewpkg           : function(subview){
			return app.getView(subview).toLowerCase();
		},
		getViewpkgPath       : function(component){
			if(app.isSubview(component)){
				var viewpkg = app.getViewpkg(component);
				return viewpkg + '.';
			}
			return '';
		},
		getAbsModel          : function(model){		
			return 	app.getAbsBasePath(model, 'model');
		},
		getAbsView           : function(view){		
			return 	app.getAbsBasePath(view, 'view');
		},
		getAbsData           : function(data){		
			return 	app.getAbsBasePath(data, 'data');
		},
		getAbsUtil           : function(util){		
			return 	app.getAbsBasePath(util, 'util');
		},
		getAbsStore          : function(store){		
			return 	app.getAbsBasePath(store, 'store');
		},
		getAbsSubview        : function(subview){		
			return 	app.getAbsView(subview);
		},
		getAbsController     : function(controller){		
			return 	app.getAbsBasePath(controller, 'controller');
		},
		getRelModel          : function(model){		
			return 	app.getRelBasePath(model);
		},
		getRelView           : function(view){
			return 	app.getRelBasePath(view);
		},
		getRelStore          : function(store){
			return 	app.getRelBasePath(store);
		},
		getRelSubview        : function(subview){
			return 	app.getRelView(subview);
		},
		getRelController     : function(controller){
			return 	app.getRelBasePath(controller);
		},
		getMergedRequires    : function(requires){
			var requiresFsl = 'apps'in requires ? requires.apps : [],
			requiresExt     = 'misc'in requires ? requires.misc : [],
			mergeRequires   = new Array();
			for(var index in requiresFsl){
				var component =  requiresFsl[index];				
				if($.range.isRange(component)){
					var series = $.range.getSeries(component);
					for(var j in series){
						mergeRequires.push(app.getAbsBasePath(series[j]));
					}
				}else{
					mergeRequires.push(app.getAbsBasePath(component));
				}
			}
			for(var index in requiresExt){
				var component =  requiresExt[index];
				mergeRequires.push(component);
			}
			return mergeRequires;
		},
		getCompType          : function(component){
			var middlePath ='';
			if(app.isView(component)||app.isSubview(component)){				
				middlePath = 'view';
			}else if(app.isController(component)){
				middlePath = 'controller';
			}else if(app.isStore(component)){
				middlePath = 'store';
			}else if(app.isModel(component)){
				middlePath = 'model';
			}else if(app.isUtil(component)){
				middlePath = 'util';
			}else if(app.isData(component)){
				middlePath = 'data';
			}
			return middlePath;
		},
		getAbsBasePath       : function(component, ctype){
			var absBasePath,
			appName          = app.getName();
			
			if(app.isModullar(component)){
				var module  = app.getModule(component),				
				submodule   = app.getSubmodule(component),				
				viewpkgPath = app.getViewpkgPath(component);
				ctype       = app.getCompType(component);
				
				if(app.isAppModule(module)){
					absBasePath = appName + '.' + ctype + '.' + submodule + '.' + viewpkgPath + component;
				}else{
					absBasePath = appName + '.' + ctype + '.' + module + '.' + submodule + '.' + viewpkgPath + component;
				}
			}else{
				absBasePath = appName + '.' + ctype + '.' + component;
			}			
			return 	absBasePath;
		},
		getRelBasePath       : function(component){
			var relBasePath;
			if(app.isModullar(component)){
				var module  = app.getModule(component),				
				submodule   = app.getSubmodule(component),				
				viewpkgPath = app.getViewpkgPath(component);
				
				if(app.isAppModule(module)){
					relBasePath = submodule + '.' + viewpkgPath + component;
				}else{
					relBasePath = module + '.' + submodule + '.' + viewpkgPath + component;
				}
			}else{
				relBasePath = component;
			}			
			return 	relBasePath;
		},
		getRequires          : function(){
			return [
				'Ext.grid.*',
				'Ext.data.*',
				'Ext.data.TreeStore',
				'Ext.ModelMgr.*',
				'Ext.panel.Panel',
				'Ext.button.Button',
				'Ext.window.Window',  
				'Ext.toolbar.TextItem',
				'Ext.menu.Menu',
				'Ext.toolbar.Spacer',
				'Ext.button.Split',
				'Ext.form.field.TextArea',
				'Ext.toolbar.Paging', 
				'Ext.ModelManager',
				'Ext.tip.QuickTipManager',
				'Ext.tree.Column',
				'Ext.tree.Panel',
				'Ext.tree.View',
				'Ext.Loader',  
				//'Ext.ux.grid.RowEditor',
				'Ext.ux.data.PagingMemoryProxy',
				'Ext.ux.PreviewPlugin',
				'Ext.ux.ProgressBarPager',
				'Ext.ux.statusbar.StatusBar',
			];
		},
		init               : function(enabled){
			Ext.Loader.setConfig({
				enabled : enabled
			});
			Ext.Loader.setPath(app.getName(), app.getPath());
			Ext.Loader.setPath('Ext.ux', app.getUxpath());
			Ext.require(app.getRequires());
		}	
	};
	
	$.app = app;
}(Fsl));

/**
 * This JavaScript Library use for perform iteration or loaping to reduce boiler plate of
 * code, optimized and maximized peformance.
 *
 * @static
 * @class       range
 * @package     Fsl.range
 * @access      public
 * @version     1.0.0
 * @since       Jun 05, 2013
 *
 **/
;Fsl.range||(function($){
	var range = {
		$class               : 'range',
		$package             : 'Fsl.range',
		SubviewRange         : /^V[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}[X]{1}[\d]{2}:[\d]{1,2}$/,
		MainCompTailRange    : /^[C|D|M|S|V|U]{1}[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{6}:[\d]{1,3}$/,	
		MainCompLeadRange    : /^[C|D|M|S|V|U]{1}[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{3}001:[C|D|M|S|V|U]{1}[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{3}$/,
		MainCompFullRange    : /^[C|D|M|S|V|U]{1}[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{3}001:[C|D|M|S|V|U]{1}[\d]{2}[B|I|Q|R|S|T|X]{1}[\d]{3}001$/,
		isSubviewRange       : function(span){
			return range.SubviewRange.test(span);
		},
		isTailRange          : function(span){
			return range.MainCompTailRange.test(span);
		},
		isLeadRange          : function(loop){
			if(range.MainCompLeadRange.test(loop)){
				var main = loop.substring(0,4),
				ref      = loop.substring(11,15);
				return main == ref;
			}
			return false;
		},
		isFullRange          : function(loop){
			if(range.MainCompFullRange.test(loop)){
				var main = loop.substring(0,4),
				ref      = loop.substring(11,15);
				return main == ref;
			}
			return false;
		},
		isRange              : function(span){
			return range.isSubviewRange(span) || range.isTailRange(span) 
			|| range.isLeadRange(span)        || range.isFullRange(span);
		},
		lpad                 : function(digit, size){
			var str 	= digit + '';
			while (str.length < size){
				str = '0' + str;
			}
			return str;
		},
		ltrim                : function(str){
			while(!(/^[1-9]{1}$/.test(str.charAt(0)))){
				str = str.substring(1);
			}
			return str;
		},
		intval               : function(str){
			return parseInt(range.ltrim(str));
		},
		getComponent         : function(span){
			if(range.isRange(span)){
				return range.isSubviewRange(span)
				? span.substring(0,13)
				: span.substring(0,10);
			}
		},
		getLimit             : function(span){
			var begRange, endRange;
			if(range.isSubviewRange(span)){
				begRange = range.intval(span.substring(11,13));
				endRange = range.intval(span.substring(14));
			}else if(range.isTailRange(span)){
				begRange = range.intval(span.substring(7,10));
				endRange = range.intval(span.substring(11));
			}else if(range.isLeadRange(span)){
				begRange = range.intval(span.substring(4,7));
				endRange = range.intval(span.substring(15,18));		
			}else if(range.isFullRange(span)){
				begRange = range.intval(span.substring(4,7));
				endRange = range.intval(span.substring(15,18));				
			}
			return begRange < endRange 
			? { beg: begRange, end: endRange } 
			: { beg: endRange, end: begRange };
		},
		getSeries            : function(span){
			var series = new Array();
			if(range.isSubviewRange(span)){
				var prefix = span.substring(0,11),
				limit      = range.getLimit(span);
				for(var index = limit.beg; index <= limit.end; index++){
					var component = prefix + range.lpad(index, 2);
					series.push(component);
				}		
			}else if(range.isTailRange(span)){
				var prefix = span.substring(0,7),
				limit      = range.getLimit(span);
				for(var index = limit.beg; index <= limit.end; index++){
					var component = prefix + range.lpad(index, 3);
					series.push(component);
				}				
			}else if(range.isLeadRange(span)){
				var prefix = span.substring(0,4),
				suffix     = span.substring(7,10),
				limit      = range.getLimit(span);
				for(var index = limit.beg; index <= limit.end; index++){
					var component = prefix + range.lpad(index, 3) + suffix;
					series.push(component);
				}	
			}else if(range.isFullRange(span)){
				var prefix = span.substring(0,4),
				suffix     = span.substring(7,10),
				limit      = range.getLimit(span);
				for(var index = limit.beg; index <= limit.end; index++){
					var component = prefix + range.lpad(index, 3) + suffix;
					series.push(component);
				};				
			}
			return series;
		}
	};
	
	$.range = range;
}(Fsl));

/**
 * This JavaScript Library use for perform crud operation by extjs data package. This
 * library will reduce boiler plate of code, optimized and maximized peformance.
 *
 * @static
 * @class       model
 * @package     Fsl.model
 * @access      public
 * @version     1.0.0
 * @since       May 29, 2013
 *
 **/
;Fsl.model||(function($){
	var model = {
		$class           : 'model',
		$package         : 'Fsl.model',
		getModel         : function(model){
			return $.app.getAbsModel(model);
		},
		getModels        : function(models){
			var list = new Array();
			for(var index in models){
				var domain = models[index];				
				if($.range.isRange(domain)){
					if($.app.isModel($.range.getComponent(domain))){
						var series = $.range.getSeries(domain);
						for(var j in series){
							list.push($.app.getRelModel(series[j]));
						}
					}
				}else{
					list.push($.app.getRelModel(domain));
				}
			}
			return list;
		},
		save             : function(domain, values, callback){
			var Entity   = Ext.create(model.getModel(domain), values);
			Entity.save(callback);
			return Entity;
		},
		load             : function(domain, values, callback){
			var Entity   = Ext.ModelManager.getModel(model.getModel(domain));
			Entity.load(values, callback);
			return Entity;
		},
		update           : function(domain, values, callback){
			var Entity   = Ext.create(model.getModel(domain), values);
			Entity.save(callback);
			return Entity;
		},
		destroy          : function(domain, values, callback){
			var Entity   = Ext.create(model.getModel(domain), values);
			Entity.destroy(callback);
			return Entity;
		}
	};
	
	$.model = model;
}(Fsl));

/**
 * This JavaScript Library use for perform crud operation by extjs data package. This
 * library will reduce boiler plate of code, optimized and maximized peformance.
 *
 * @static
 * @class       store
 * @package     Fsl.store
 * @access      public
 * @version     1.0.0
 * @since       May 29, 2013
 *
 **/
;Fsl.store||(function($){
	var store = {
		$class           : 'store',
		$package         : 'Fsl.store',
		getStore         : function(storeName){
			var store = $.app.getRelStore(storeName);
			return Ext.data.StoreManager.get(store);
		},
		getStores        : function(stores){
			var list = new Array();
			for(var index in stores){
				var store = stores[index];		
				if($.range.isRange(store)){
					if($.app.isStore($.range.getComponent(store))){
						var series = $.range.getSeries(store);
						for(var j in series){
							list.push($.app.getRelStore(series[j]));
						}
					}
				}else{
					list.push($.app.getRelStore(store));
				}
			}
			return list;
		},
		save             : function(){
			//TODO
		},
		load             : function(storeName, callback){
			var store    = getStore(storeName);
			store        = store ? store  : Ext.create(storeName);
			store.load(callback);
		},
		update           : function(){
			//TODO
		},
		destroy          : function(){
			//TODO
		},
		getFilter        : function(ostore){
			var Filter = function(ostore){
				var filters    = new Array(),
				isStoreObject  = function(){
					return !$.regexp.isUndefined(ostore) 
						&& $.regexp.isObject(ostore) 
						&& 'storeId' in  ostore;
				},
				isStoreName    = function(){
					return $.regexp.isString(ostore);
				},
				getStoreObject = function(){
					if(isStoreObject()){
						return ostore;
					}else if(isStoreName()){
						return store.getStore(ostore);
					}
				};
				this.add       = function(property, value){
					if(!$.regexp.isEmpty(value)){
						filters.push({property: property, value: value});
					}
					return this;
				};
				this.load      = function(page, options){
					if(filters.length > 0){
						var cstore = getStoreObject();
						cstore.clearFilter();
						if(!$.regexp.isUndefined(options) && $.regexp.isObject(options)){
							options.filters = filters;
							cstore.loadPage(page, options);
						}else{
							cstore.loadPage(page, {filters:filters});
						}
					}
				};
			};
			return new Filter(ostore);
		}
	};
	$.store = store;
}(Fsl));

/**
 * This JavaScript Library use for presentation layer for views. Very much useful
 * for manipulation extjs views, this library will reduce boiler plate of code, 
 * optimized and maximized peformance.
 *
 * @static
 * @class       view
 * @package     Fsl.view
 * @access      public
 * @version     1.0.0
 * @since       Jun 02, 2013
 *
 **/
;Fsl.view||(function($){
	var view = {
		$class           : 'model',
		$package         : 'Fsl.model',
		getView          : function(alias){
			return Ext.widget(alias);
		},
		getViews         : function(views){
			var list = new Array();
			for(var index in views){
				var view = views[index];				
				if($.range.isRange(view)){
					var component = $.range.getComponent(view);
					if($.app.isView(component) || $.app.isSubview(component)){
						var series = $.range.getSeries(view);
						for(var j in series){
							list.push($.app.getRelView(series[j]));
						}
					}
				}else{
					list.push($.app.getRelView(view));
				}
			}
			return list;
		}
	};
	
	$.view = view;
}(Fsl));

/**
 * This JavaScript Library use for controller layer for Ext MVC. Very much useful
 * for manipulation extjs views, this library will reduce boiler plate of code, 
 * optimized and maximized peformance.
 *
 * @static
 * @class       controller
 * @package     Fsl.controller
 * @access      public
 * @version     1.0.0
 * @since       Jun 02, 2013
 *
 **/
;Fsl.controller||(function($){
	var controller = {
		$class           : 'model',
		$package         : 'Fsl.model',
		getControllers   : function(controllers){
			var list    = new Array();
			for(var index in controllers){
				var controller = controllers[index];				
				if($.range.isRange(controller)){
					if($.app.isController($.range.getComponent(controller))){
						var series = $.range.getSeries(controller);
						for(var j in series){
							list.push($.app.getRelController(series[j]));
						}
					}
				}else{
					list.push($.app.getRelController(controller));
				}
			}
			return list;
		}
	};
	
	$.controller = controller;
}(Fsl));

/**
 * This JavaScript Library use for observation loader. This liberary observating
 * visualized loading progress.
 *
 * @static
 * @class       loader
 * @package     Fsl.loader
 * @access      public
 * @version     1.0.0
 * @since       Jun 03, 2013
 *
 **/
;Fsl.loader||(function($){
	var loader = {
		$class      : 'loader',
		$package    : 'Fsl.loader',
		setMessage  : function(message){
			var loadercomp     = 'fsl-loading-msg',
			progress           = document.getElementById(loadercomp);
			progress.innerHTML = message;
		},
		loadingFsl  : function(){
			loader.setMessage('Loading Fsl Core API...');
		},
		loadingDB   : function(){
			loader.setMessage('Loading Fsl Offline DB...');
		},
		loadingExt  : function(){
			loader.setMessage('Loading Ext Core API...');
		},
		loadingUI   : function(){
			loader.setMessage('Loading Ext UI Components...');
			loader.setMessage('Initializing...');
		},
		complete    : function(){
			(Ext.defer(function() {
				var hideMask = function () {
					Ext.get('fsl-loading').remove();
					Ext.fly('fsl-loading-mask').animate({
						opacity : 0,
						remove  : true
					});
				};
				Ext.defer(hideMask, 250);      
			}, 500));
		}
	};	
	$.loader = loader;
}(Fsl));

/**
 * This JavaScript Library use for severity. for example debug, info, warn, error.
 * Severity message ensure the importance of different type of application message.
 *
 * @static
 * @class       severity
 * @package     Fsl.severity
 * @access      public
 * @version     1.0.0
 * @since       Jun 03, 2013
 *
 **/
;Fsl.severity||(function($){
	var severity = {
		$class      : 'severity',
		$package    : 'Fsl.severity',
		setStatus   : function(statusbar, text, iconCls, delay){
			statusbar.setStatus({
				text    : text,
				iconCls : iconCls,
				clear   : {
					wait: delay,
					anim: false,
					useDefaults: true
				}
			});    
		},
		getString   : function(message){
			if($.regexp.isString(message)){
				return message;
			}else if($.regexp.isArray(message)){
				var fullstr = '';
				for(var index in message){
					var str = message[index];
					if($.regexp.isString(str)){
						fullstr += str + ', ';
					}else{
						fullstr += severity.getString(str); 
					}
				}
				return fullstr;
			}
			return '';
		},
		getMessage  : function(message){
			if($.regexp.isString(message)){
				return message;
			}else if($.regexp.isObject(message)){
				if('response' in message){
					var response = message.response;
					if('responseText' in response){
						var responseText = response.responseText,
						json     	     = Ext.decode(responseText);
						return 'message' in json ? severity.getString(json.message) : '';						
					}
				}else if('error' in message){
					var error = message.error;
					return severity.getString(error);
				}
			}
			return '';
		},
		debug       : function(statusbarId, message){
			var text  = '<p style="color: green">' + severity.getMessage(message) + '</p>',
			statusbar = Ext.getCmp(statusbarId),
			iconCls   = 'fsl-severity-debug';
            severity.setStatus(statusbar, text, iconCls, 6000);
		},
		info        : function(statusbarId, message){
			var text  = '<p style="color: darkgreen">' + severity.getMessage(message) + '</p>',
			statusbar = Ext.getCmp(statusbarId),
			iconCls   = 'fsl-severity-info';
            severity.setStatus(statusbar, text, iconCls, 6000);
		},
		warn        : function(statusbarId, message){
			var text  = '<p style="color: orange">' + severity.getMessage(message) + '</p>',
			statusbar = Ext.getCmp(statusbarId),
			iconCls   = 'fsl-severity-warn';
            severity.setStatus(statusbar, text, iconCls, 6000);
		},
		error       : function(statusbarId, message){
			var text  = '<p style="color: red">' + severity.getMessage(message) + '</p>',
			statusbar = Ext.getCmp(statusbarId),
			iconCls   = 'fsl-severity-error';
            severity.setStatus(statusbar, text, iconCls, 6000);
		}
	};	
	$.severity = severity;
}(Fsl));

/**
 * This JavaScript Library use for Message box to show alert for differents types
 * serverity message, confirm etc.
 *
 * @static
 * @class       mbox
 * @package     Fsl.mbox
 * @access      public
 * @version     1.0.0
 * @since       Jun 08, 2013
 *
 **/
;Fsl.mbox||(function($){
	var mbox = {
		$class         : 'mbox',
		$package       : 'Fsl.mbox',
		destroy        : function(scope, entity, values, status){
			Ext.MessageBox.show({
				title       : 'Delete',
				msg         : 'Really want to delete ?',
				icon        : Ext.Msg.WARNING,
				buttons     : Ext.MessageBox.YESNO,
				buttonText  : { 
					yes: "Delete", 
					no : "No" 
				},
				scope       : scope,
				fn          : function(btn, dbQty){
					if(btn == 'yes'){
						var store = scope.store;
						$.model.destroy(entity, values, {
							scope   : this,
							success : function(model, operation) { 
								if(model != null){                    
									$.severity.info(status, operation);
									store.load();						
								}
							},
							failure : function(model, operation){
								$.severity.error(status, operation);
							}
						});
					}
				}
			});
		}
	};	
	$.mbox = mbox;
}(Fsl));

/**
 * This JavaScript Library use for most commons toolbars, used by the Extjs 4.1 apps,
 * it's a reusable toolbar library.
 *
 * @static
 * @class       tbar
 * @package     Fsl.tbar
 * @access      public
 * @version     1.0.0
 * @since       Jun 08, 2013
 *
 **/
;Fsl.tbar||(function($){
	var tbar = {
		$class         : 'tbar',
		$package       : 'Fsl.tbar',
		getTB01I001    : function(handler){
			var toolbar = Ext.create('Ext.ux.StatusBar', {            
				topBorder       : false,
				statusAlign     : 'right',
				items    : [
					{
						xtype       : 'button',
						text        : 'ADD',
						icon        : $.route.getImage('ADD01003.png'),
						listeners   : {
							click   : handler
						}
					}
					,'-'
				]
			});
			return toolbar;
		}
	};	
	$.tbar = tbar;
}(Fsl));

/**
 * This JavaScript Library use for most commons statusbars, used by the Extjs 4.1 apps,
 * it's a reusable toolbar library.
 *
 * @static
 * @class       bbar
 * @package     Fsl.bbar
 * @access      public
 * @version     1.0.0
 * @since       Jun 08, 2013
 *
 **/
;Fsl.bbar||(function($){
	var bbar = {
		$class         : 'bbar',
		$package       : 'Fsl.bbar',
		getBB01I001    : function(statusbarid){
			var bottombar = Ext.create('Ext.ux.StatusBar', {
				id              : statusbarid,
				topBorder       : false,
				text            : 'Status',
				defaultIconCls  : 'fsl-severity-info',
				defaultText     : 'Status',
				statusAlign     : 'left'
			});
			return bottombar;
		}
	};	
	$.bbar = bbar;
}(Fsl));

/**
 * This JavaScript Library use for initial configuration of Extjs 4.1 apps, To
 * configuare application bootstrap initially.
 *
 * @static
 * @class       cfg
 * @package     Fsl.cfg
 * @access      public
 * @version     1.0.0
 * @since       Jun 02, 2013
 *
 **/
/*;Fsl.cfg||(function($){
	var cfg = {
		$class      : 'cfg',
		$package    : 'Fsl.cfg',
		appName     : 'Fsl.admin',
		appFolder   : 'app',
		uxFolder    : 'ux'
	};	
	$.cfg = cfg;
}(Fsl));*/
